﻿using DAO;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace WebApplication.Models
{
    public class ReportModel : IModel<Report>
    {
        //public int id { get; set; }

        [Required]
        [Display(Name="Название отчета")]
        public string Name { get; set; }

        [Required]
        [DataType(System.ComponentModel.DataAnnotations.DataType.MultilineText)]
        [Display(Name="Описание")]
        public string Description { get; set; }

        [Required]
        [Display(Name="Настройка")]
        public string Settings { get; set; }

        public Report ToEfEntity()
        {
            return new Report
            {
                DateCreate = DateTime.Now,
                Description = Description,
                Name = Name,
                XmlSettings = Settings
            };
        }
    }
}